package offer;

public class Ex46 {
    int res = 0;
    public int translateNum(int num) {
        String s = ""+num+" ";  //忘了怎么转换
        dfs(s,0);
        return res;
    }
    public void dfs(String s,int p){
        if(s.length()-1<=p){
            res++;
            return;
        }

        for(int i = 1;i<=2;i++){
            if(p+i<=s.length()-1){
                int t = Integer.parseInt(s.substring(p,p+i));   //截取字符函数忘了，
                if(t<=25){
                    dfs(s,p+i);
                }
            }
        }
    }

    public static void main(String[] args) {
        Ex46 ex46 = new Ex46();
        ex46.translateNum(25);
    }
}
